<!DOCTYPE html>
<html lang="en">
<head>
    <!--<meta charset="UTF-8">-->
    <title>test div</title>
    <script type="text/javascript" src="/jquery-3.2.1.js"></script>
    <script type="text/javascript">
      $(document).ready(function () {
          $("button").click(function () {
              var div_node = $("li div:eq(0)");
              var div_str = div_node.text();
              console.log(div_str);
              var li_node = div_node.parent();
              var lipre_node = li_node.prev();
              var lipre_str = lipre_node.text();
              console.log(lipre_str);
          });
      });


    </script>
</head>
<body>

<ul>
    <li>aaaa</li>
    <li>bbbb</li>
    <li>cccc</li>
    <li>
        <div>dddd</div>
    </li>
    <li>eeee</li>
    <li>ffff</li>
</ul>
<button >获取值</button>>
</body>
</html>